<html>
<head>
  <title>Native Client SSH Client demo</title>
  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans+Mono">
  <script type="text/javascript" src="ssh.js"> </script>
  <script type="text/javascript" src="main.js"> </script>
  <script type="text/javascript" src="terminal.js"> </script>
  <script type="text/javascript" src="parser.js"> </script>
  <script type="text/javascript" src="web2socket.js"></script>

  <style type="text/css">
    tr {
      font-family: 'Droid Sans Mono', courier, fixed, monospace;
      font-size: 12pt;
    }
  </style>

<script type="text/javascript">
function start() {
  var body = document.getElementById('body_');
  body.onkeypress=function() { keyPressHandler(window.event.charCode);};
  body.onkeydown=function() { keyDownHandler(window.event.keyCode); };

  document.getElementById('parametersDiv').style.display = 'none';

  var proxyURI = web2socket.getProxyURI();
  var host = document.getElementById('hostname').value;
  if (host.indexOf(':') < 0) {
    host = host + ':22';
  }
  var user = document.getElementById('username').value;
  var pwd = document.getElementById('pwd').value;
  initTerminal();
  loadData(proxyURI, host, user, pwd);
}
</script>

</head>

<body id='body_'>
  <div id="nacl_ssh_plugin_content"></div>
  <script type="text/javascript">
    var contentDiv = document.getElementById('nacl_ssh_plugin_content');
    loadNaClSSHClient(contentDiv,
                      'ssh_plugin',
                      'x86-32: ssh_plugin_x86_32.nexe?rnd=' + Math.random() + '\nx86-64: ssh_plugin_x86_64.nexe?rnd=' + Math.random());

  </script>
  <div id = 'parametersDiv'>
Host:port: <input id=hostname type=text value=""> &nbsp;&nbsp;&nbsp; User:
<input id=username type=text value="">  &nbsp;&nbsp;&nbsp;    Password: <input
id='pwd' type='password' onKeyPress='if (event.which == 13) { start(); return
false;}'> &nbsp;&nbsp;&nbsp; <button id=startButton onclick='start()'>Start SSH session</button>
</div>
<div id='terminal'>
  <table id='termTable' border='0' cellSpacing='0' cellPadding='0'>
  </table>
</div>
<input id=inputbox type=text style="visibility:hidden" onfocus="setFocusToTerm();"/>
<pre id=log></pre>
</body>
</html>
